<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Home\Controller;
use OT\DataDictionary;

/**
 * 前台首页控制器
 * 主要获取首页聚合数据
 */
class IndexController extends HomeController {

	//系统首页
    public function index(){

        // $category = D('Category')->getTree();
        // $lists    = D('Document')->lists(null);

        // $this->assign('category',$category);//栏目
        // $this->assign('lists',$lists);//列表
        // $this->assign('page',D('Document')->page);//分页

    // 欲先访问我们的操作页面 必须先进行登录
    // if($_SESSION['home']['user_auth'] == null)
    //  { 
    //  //    echo "<pre>";
    //  //    print_R($_SESSION);

    //    $this->display("Public/login");   
    //  }else{
      
        if(stripos($_SERVER["HTTP_USER_AGENT"],"firefox")){ 
            // echo "<pre>";
            // print_R($_SESSION);
            if($_SESSION['onethink_home']['user_auth'] == null){

                  $this->display("Public/login");
            }else{
                  
                  $this ->display('Index/index');

            }
 

        }else{

             if($_SESSION['home']['user_auth'] == null){
                  // echo "<pre>";
                  // print_R($_SESSION);
                   $this->display("Public/login");

                }else{

                    $this->display("Index/index");
                }
        } 
        







    //    $this->display("Index/index");   
    //  }
 
    // }

    // public function index_zhuye()
    // {
    //       echo "<pre>";
    //     print_R($_SESSION);
    //       echo "<pre>";
    //     print_r($_SESSION);
    // }

    }

}